package com.aaa.security.handler;

import com.aaa.core.entity.Results;
import com.aaa.security.exception.PermissionException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author ：ludi（206913808@qq.com）
 * @date ：Created in 2022/12/2 22:46
 * @description：
 * @modified By：
 * @version:
 */

/**
 * 标记全局异常类
 */
@RestControllerAdvice
public class MyGlobleHandler {
    @ExceptionHandler(value = PermissionException.class)
    public Results<String> permissonException(PermissionException e){
        return new Results<>(4001,e.getMessage());
    }
}